#pragma once
#include <vector>

struct IDXGIAdapter1;
struct IDXGIOutput1;
struct ID3D11Device;
struct IDXGIOutputDuplication;
struct ID3D11Texture2D;

class _declspec(dllimport) Monitor {
public:
	Monitor(IDXGIAdapter1* _adapter, IDXGIOutput1* _output);
	void init();
	bool get(uint8_t* _buffer, size_t _size);
	size_t get_monitor_buffer_size();
	~Monitor();
private:
	IDXGIAdapter1* m_adapter = nullptr;
	IDXGIOutput1* m_output = nullptr;
	ID3D11Device* m_device = nullptr;
	// D3D_FEATURE_LEVEL* m_feature_level = nullptr;
	IDXGIOutputDuplication* m_duplication = nullptr;
	int m_width = -1;
	int m_height = -1;

	bool copy_frame_data(ID3D11Texture2D* _texture, uint8_t* _buffer, size_t _size);
};

void _declspec(dllimport) enum_monitor(std::vector<Monitor*>*& monitor_vector);

void _declspec(dllimport) release_monitor_v(std::vector<Monitor*>* monitor_vector);
